﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Samples/Sample.Master" AutoEventWireup="true"
    CodeBehind="UpdatePanel.aspx.cs" Inherits="JQueryControlToolkit.Sample.Web.Samples.UpdatePanel" %>

<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
    <asp:ScriptManagerProxy runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="JQuery" Name="JQueryControlToolkit.Controls.labs_json.js" />
        </Scripts>
    </asp:ScriptManagerProxy>

    <script runat="server">
        protected void DoSomething(object sender, EventArgs e)
        {
            ((Label)((Control)sender).Parent.Controls[1]).Text = "done";
        }
    </script>

    <asp:Panel ID="up1" runat="server" CssClass="updatePanel">
        <asp:Label ID="result" runat="server" Text="not done yet" />
        <asp:Button ID="Button1" runat="server" Text="click me" OnClick="DoSomething" />
    </asp:Panel>
    <asp:Panel ID="Panel1" runat="server" CssClass="updatePanel">
        <asp:Label ID="Label1" runat="server" Text="not done yet" />
        <asp:Button ID="Button2" runat="server" Text="click me" OnClick="DoSomething" />
    </asp:Panel>
    <asp:Panel ID="Panel2" runat="server" CssClass="updatePanel">
        <asp:Label ID="Label2" runat="server" Text="not done yet" />
        <asp:Button ID="Button3" runat="server" Text="click me" OnClick="DoSomething" />
    </asp:Panel>
    <asp:Panel ID="Panel3" runat="server" CssClass="updatePanel">
        <asp:Label ID="Label3" runat="server" Text="not done yet" />
        <asp:Button ID="Button4" runat="server" Text="click me" OnClick="DoSomething" />
    </asp:Panel>
    <asp:Panel ID="Panel4" runat="server" CssClass="updatePanel">
        <asp:Label ID="Label4" runat="server" Text="not done yet" />
        <asp:TextBox runat="server" OnTextChanged="DoSomething" />
    </asp:Panel>

    <script type="text/javascript">
        $(".updatePanel").updatePanel();
    </script>

</asp:Content>
